package com.sinooceangroup.capital.consumer.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * Ribbon Demo
 * @author: Leo.Wang, adwyxx@qq.com
 * @date: 2020/7/17 13:11
 */
@RestController
public class RibbonController {
    /***
     * RestTemplate
     */
    @Autowired
    RestTemplate restTemplate;


    @GetMapping("/api/hello-world")
    public String invokeHelloWorld(){
        String result = restTemplate.getForObject("http://productor-service/productor/api/hello-world",String.class);
        return result;
    }
}
